﻿<div class="easyui-layout" data-options="fit: true">
    <div data-options="region:'north',border: false,split:true">
        <div class="data-tools clearfix">
            <div class="pull-left form-inline ">
            </div>
            <div class="pull-right">
                <form class="form-inline" id="formSearch">
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">物料名称：</label>
                        <input class="form-control" name="name" type="text" autocomplete="off">
                    </div>

                    <button type="button" class="btn btn-default btn-sm active" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                </form>
            </div>
        </div>
    </div>
    <div data-options="region: 'center',  border: false">
        <table id="commonProductDG"></table>
    </div>
</div>
<script type="text/javascript">
    //定义datagrid
    var commonProductDG = $("#commonProductDG");

    $(function() {
        //绑定datagrid
        Topro.UI.DataGrid(commonProductDG, {
            method: "get",
            url: "@Url.Action("ProductQuery","Module")",
            queryParams: null,
            idField: 'id',
            fit: true,
            remoteSort: false,
            multiSort: false,
            pagination: true,
            singleSelect: window.top._isProductSingle, //是否支持单选
            rownumbers: true,   //行号
            frozenColumns: [
                [
                    { field: 'ck', checkbox: true }
                ]
            ],
            columns: [
                [
                    {
                        field: 'name',
                        title: '物料名称',
                        width: 230
                    },
                    {
                        field: 'code',
                        title: '物料编码',
                        width: 140
                    },
                    {
                        field: 'mnemonicCode',
                        title: '助记码',
                        width: 140
                    },
                    {
                        field: 'barcode',
                        title: '条码',
                        width: 140
                    },
                    {
                        field: 'remark',
                        title: '备注',
                        width: 140
                    }
                ]
            ],
            rowTooltip: false
        });
        //单选隐藏
        if (window.top._isSingle) {
            $(".datagrid-header-check input[type='checkbox']").css('display', 'none');
        }
    });
</script>
